package com.cloud.pages;

import org.openqa.selenium.By;

import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;

public class ForgotPassPage extends AnyPage {

    //Constructor
    public ForgotPassPage(PageManager pages) {
        super(pages);
    }


    //Variables
    private String forgotPassPageTitle = "Forgot password - Swivl";


    //Methods
    public ForgotPassPage ensurePageLoaded() {
        wait.until(presenceOfElementLocated(By.xpath("//*[@id=\"_submit\"][text()='Reset password']")));
        return this;
    }

    public boolean isLoaded() {
        try {
            wait.until(presenceOfElementLocated(By.id("//*[@id=\"_submit\"][text()='Reset password']")));
            return true;
        } catch (Exception e) {
            return false;
        }
    }

    public String getForgotPassPageTitle() {
        return forgotPassPageTitle;
    }

}
